package ar.edu.caece.compiler.grammar.terminals;


import ar.edu.caece.compiler.error.ErrorManager;
import ar.edu.caece.compiler.error.ParsingException;
import ar.edu.caece.compiler.grammar.Recognizer;
import ar.edu.caece.compiler.grammar.TokenRecognizer;
import ar.edu.caece.compiler.grammar.TokenVisitor;
import ar.edu.caece.compiler.model.Token;

public class ErrorToken extends TokenRecognizer {

  public ErrorToken(Token token) {
    super(token);
  }
  
  @Override
  public Recognizer execute(TokenVisitor visitor) throws Exception {
    throw new ParsingException("Lexical error on " + getToken().getPos() + ", invalid identifier " + getToken().getSymbol().getRepresentation(), null, this);
  }
}
